<div class="content-wrapper" [@routerTransition]>
    <sub-header  idName="Administration.WorkFlowManager" [title]="'WorkFlowManager' | localize">
        <div role="actions">

        </div>
    </sub-header>
    <section class="content d-flex flex-column flex-column-fluid">
        <div [class]="containerClass">
            <div class="card card-custom gutter-b">
                <div class="card-body">
                    <form class="form" autocomplete="new-password">
                        <div>
                            <div class="row align-items-center mb-4">
                                <div class="col-xl-3">
                                    <div class="form-group">
                                        <input class="form-control" id="StartEndRange" name="StartEndRange"
                                            #drp="bsDaterangepicker" readonly="readonly" bsDaterangepicker
                                            dateRangePickerLuxonModifier [(date)]="dateRange" />
                                    </div>
                                </div>
                                <div class="col-xl-6">
                                    <div class="form-group m-form__group align-items-center">
                                        <div class="input-group">
                                            <input [(ngModel)]="filterText" name="filterText" autoFocus
                                                class="form-control m-input" [placeholder]="l('SearchWithThreeDot')"
                                                type="text">
                                            <div class="input-group-append">
                                                <button (click)="getListData()" class="btn btn-default" type="submit"><i
                                                        class="icon-magnifier"
                                                        [attr.aria-label]="l('Search')"></i></button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>

                    <div class="row">
                        <tabset class="ui-tabs-nav">
                            <tab (selectTab)="onTabSelect($event,i)" heading="{{item.name}}"
                                [active]="pagedPaperParam.paperState === item.paperState"
                                *ngFor="let item of actionNames,let i = index">
                            </tab>
                        </tabset>
                    </div>

                    <div class="row align-items-center">
                        <!--<Primeng-TurboTable-Start>-->
                        <div class="primeng-datatable-container" [busyIf]="primengTableHelper.isLoading">
                            <p-table #dataTable sortMode="multiple" (onLazyLoad)="getListData($event)"
                                [value]="primengTableHelper.records"
                                rows="{{primengTableHelper.defaultRecordsCountPerPage}}" [paginator]="false"
                                [lazy]="true" [scrollable]="true" ScrollWidth="100%"
                                [responsive]="primengTableHelper.isResponsive"
                                [resizableColumns]="primengTableHelper.resizableColumns">
                                <ng-template pTemplate="header">
                                    <tr>
                                        <th style="width: 120px;max-width: 120px;">
                                            流程
                                        </th>
                                        <th style="width: 320px">
                                            标题
                                        </th>
                                        <th style="width: 80px;max-width: 80px;">
                                            经办人
                                        </th>
                                        <th style="width: 120px;max-width: 120px;">
                                            步骤
                                        </th>
                                        <th style="width: 120px;max-width: 120px;">
                                            {{'CreationTime' | localize}}
                                        </th>
                                        <th style="width: 80px;max-width: 80px;">
                                            {{'Actions' | localize}}</th>
                                    </tr>
                                </ng-template>
                                <ng-template pTemplate="body" let-record="$implicit">
                                    <tr>
                                        <td style="width: 120px;max-width: 120px;">
                                            {{record.workFlowName}}
                                        </td>
                                        <td style="width: 320px">
                                            <span class="p-column-title"> {{'Title'| localize}}</span>
                                            <a (click)="goDetailModel(record.paperId)" href="javascript:void(0)">
                                                {{record.title}}
                                            </a>
                                        </td>
                                        <td style="width: 80px;max-width: 80px;">
                                            {{record.userName}}
                                        </td>
                                        <td style="width: 120px;max-width: 120px;">
                                            {{record.nodeName}}
                                        </td>
                                        <td style="width: 120px;max-width: 120px;">
                                            <span class="p-column-title"> {{'CreationTime' | localize}}</span>
                                            {{record.creationTime | luxonFormat:'yyyy-MM-dd HH:mm:ss'}}
                                        </td>
                                        <td style="width: 80px;max-width:80px;">
                                            <a class="edit mr-2" href="javascript:void(0)"
                                                (click)="goDetailModel(record.paperId)">{{"LookOver" | localize}}</a>
                                            <a class="recall" href="javascript:void(0)"
                                                *ngIf="adminPermission && pagedPaperParam.paperState === 3"
                                                (click)="delete(record.paperId)">{{"Delete" | localize}}</a>
                                        </td>
                                    </tr>
                                </ng-template>
                            </p-table>
                            <div class="primeng-no-data" *ngIf="primengTableHelper.totalRecordsCount == 0">
                                {{'NoData' | localize}}
                            </div>
                            <div class="primeng-paging-container">
                                <p-paginator [rows]="primengTableHelper.defaultRecordsCountPerPage" #paginator
                                    (onPageChange)="getListData($event)"
                                    [totalRecords]="primengTableHelper.totalRecordsCount"
                                    [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage"
                                    [showCurrentPageReport]="true"
                                    [currentPageReportTemplate]="'TotalRecordsCount' | localize:primengTableHelper.totalRecordsCount">
                                </p-paginator>
                            </div>
                        </div>
                        <!--<Primeng-TurboTable-End>-->
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
<workFlowDetail #workFlowDetail (backListEvent)="backToList($event)"></workFlowDetail>
<workFlowManagerDetail #WorkflowManagerDetail (backListEvent)="backToList($event)"></workFlowManagerDetail>
